<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>项目详情-采购询价</title>
<link href="/res/css/respective/priceAsk/buyer.css" rel="stylesheet">
    <script src="/res/js/common/jquery.1.9.1.min.js"></script>
</head>
<body>
[#assign  menucode ="myProject"]
	<div class="warp">
		[#include "/front/common/front_headAzt.html"]
		<div class="backcontent">
			[#include "/front/common/front_leftAzt.html"]
			<div class="back-main">
				<div class="mainContent">
					<div class="mainContentWhite">
						<h1>项目详情</h1>
						<label class="opDetail" style="text-align: right; float: right;">
                            [#if project.state!=2 && userid == project.userId!0]
                            <a onclick="closeproject(${project.id})"   style="margin-right: 25px;"  >取消项目</a>
                            [/#if]
							<a href="/enquiry/project/list">返回我的项目</a></label>
						<hr>
							<h2>项目基本信息</h2>
							<div class="baseInfo">
								<div>
									<dfn>
										项目名称：<span>${project.projectName!} </span>
									</dfn>
									<dfn>
										发布公司：<span>${project.companyName!} </span>
									</dfn>
								</div>
								<div>
									<dfn>
										甲方名称：<span>${project.customerName!}</span>
									</dfn>
									<dfn>
										项目所在地：<span>${project.getAddressName("-")}</span>
									</dfn>
								</div>
								<div>
									<dfn>
										创建人员：<span>${project.userName!}</span>
									</dfn>
								</div>
							</div>
						<table class="table noBorder">
							<caption class="buyerTab">
								 <button class="tabButt tabButtActive" onclick="go(${project.id},2)" type="button">采购询价</button>
                                <button class="tabButt" onclick="go(${project.id},1)" type="button">预算询价</button>
                                <button class="tabButt" style="border-right: 1px solid #e9e9e9;" onclick="go(${project.id},3)" type="button">成本核算</button>
                                [#if userid==(project.userId!0) && project.state==1]
                                <button class="roleButt" onclick="createpurchase(${project.id})"  type="button">发布采购询价</button>
                                [/#if]
							</caption>
                            <thead>
                            <tr>
                                <th style="width: 15%;">询价名称</th>
                                <th style="width: 10%;">发布类型</th>
                                <th style="width: 10%;">状态</th>
                                <th style="width: 15%;">发布日期</th>
                                <th style="width: 15%;">截止日期</th>
                                <th style="width: 15%;">回复情况</th>
                                <th style="width: 20%;">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <!--默认显示8行-->
							[#if pagination?? ]
								[#list pagination.list as enq]
                                <tr>
                                    <td class="textoverflow">
                                        <a class="opLink" title="${enq.enquiryName!}" style="cursor: pointer;"  target="_blank" href="/xmh/${enq.id}"  >${enq.enquiryName!}</a>
                                    </td>
                                    <td>[#if enq.pubtype??][#if enq.pubtype==1]公开发布[#else]不公开发布[/#if][/#if]</td>
                                    <td class="shenHeState">
                                        [#if enq.state == 0 ]
                                            <img alt="" src="/res/images/oparaStatus/stateIcon_03.png">
                                        [#elseif  enq.state ==1 ]
                                            <img alt="" src="/res/images/oparaStatus/stateIcon_06.png">
                                        [#elseif  enq.state ==2 ]
                                            <img alt="" src="/res/images/oparaStatus/stateIcon_08.png">
                                        [#elseif  enq.state ==3 ]
                                            <img alt="" src="/res/images/oparaStatus/stateIcon_10.png">
                                        [#elseif  enq.state ==4 ]
                                            <img alt="" src="/res/images/oparaStatus/stateIcon_13.png">
                                        [#elseif  enq.state ==5 ]
                                            <img alt="" src="/res/images/oparaStatus/stateIcon_13.png">
                                        [/#if]
                                        <dfn>${EnqEnquiryEnum.getName(enq.state!0)}</dfn>
                                    </td>
                                    <td>${enq.pubdate?string("yyyy-MM-dd")}</td>
                                    <td>${enq.deadline?string("yyyy-MM-dd")}</td>
                                    <td>${enq.quoteCount!}</td>
                                    <td>

                                       [#if enq.quoteCount?? && enq.quoteCount!=0  ]
                                        <a class="opLink" style="margin-right: 10px;" href="/enquiry/purchase/quote/detail/${enq.id}"  >查看报价</a>
                                       [#else ]
                                            [#if enq.createUserId == userid  && enq.state!=4 ]
                                                <a class="opLink"  href="/enquiry/purchase/editor/${enq.id}" >修改询价</a>
                                            [/#if]
                                       [/#if]
                                        <a class="opLink" href="/enquiry/purchase/detail/${enq.id}" >查看详情</a>
                                    </td>
                                </tr>
								[/#list]
							[/#if]
                            </tbody>
                            <tfoot class="goFenYe">
							[@fenye p = pagination form = 'infoForm' /]
                            </tfoot>
                        </table>

					</div>
				</div>
			</div>
			<!-- 底部菜单-->
			[#include "/front/common/front_footerAzt.html"]
		</div>

	</div>

	<script src="/res/js/buyer/buyer.js"></script> 
	<script src="/res/js/common/common.js"></script>
    <script src="/res/third/layer/layer.js"></script>
    <script src="/res/third/layer/layer.extends.js"></script>
	<script type="text/javascript">
    function go(id,type){
        window.location.href= "/enquiry/project/detail/p/"+id+"/t/"+type;
    }
    /*发布采购询价*/
    function createpurchase(projectId) {
        location.href="/enquiry/purchase/choose/"+projectId;
    }
    function closeproject(projectId) {
        layer.confirm("确认取消项目?",function () {
            layer.post({
                url:"/enquiry/project/close",
                data:{projectId:projectId},
                success:function (data) {
                    if(data.success) {
                        location.reload();
                    }else{
                        layer.msgShort("有待付款订单,不能取消!")
                    }
                }

            })
        })
    }
</script>
</body>
</html>
